package dujiu.luogu.circulation;

import java.util.Scanner;

/**
 * @author dujiu
 * @date 2025/3/1
 * @Description
 */
public class P5719 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        // 和
        int count1 = 0;
        int count2;
        int count = 0; // 计算数组之和
        // 个数
        int num1 = 0;
        int num2;
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = i+1;
            count += array[i];
            if (array[i] % k == 0){
                num1++;
                count1 += array[i];
            }
        }
        count2 = count - count1;
        num2 = array.length - num1;
        System.out.printf("%.1f %.1f",(float)count1/num1,(float)count2/num2);
    }
}
